<?php
require 'isok.php';
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>Dashboard &laquo; Admin</title>
  <link rel="stylesheet" href="css/bootstrap.css">
  <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css">
  <link rel="stylesheet" href="css/nprogress.css">
  <link rel="stylesheet" href="css/admin.css">
  <script src="js/nprogress.js"></script>
</head>
<body>
  <script>NProgress.start()</script>

  <div class="main">
    <nav class="navbar">
      <button class="btn btn-default navbar-btn fa fa-bars"></button>
      <ul class="nav navbar-nav navbar-right">
          <li><a href="profile.php"><i class="fa fa-user"></i>个人中心</a></li>
          <li><a href="login.php"><i class="fa fa-sign-out"></i>退出</a></li>
      </ul>
    </nav>
    <div class="container-fluid">
      <div class="page-title">
          <h1><?php echo $one['nickname'];?>的资料</h1>
      </div>
      <!-- 有错误信息时展示 -->
      <!-- <div class="alert alert-danger">
        <strong>错误！</strong>发生XXX错误
      </div> -->
      <form class="form-horizontal" action="userssave.php?id=<?php echo $one['id']?>" method="post" enctype="multipart/form-data">
        <div class="form-group">
          <label class="col-sm-3 control-label">头像</label>
          <div class="col-sm-6">
            <label class="form-image">
              <input id="avatar" type="file">
              <img src="<?php echo $one['avatar'];?>" style="width: 80px; height: 80px;"/>
              <i class="mask fa fa-upload"></i>
            </label>
          </div>
        </div>
        <div class="form-group">
          <label for="email" class="col-sm-3 control-label">邮箱</label>
          <div class="col-sm-6">
              <input id="email" class="form-control" name="email" type="type" value="<?php echo $one['email'];?>" placeholder="邮箱" readonly>
            <p class="help-block">登录邮箱不允许修改</p>
          </div>
        </div>
        <div class="form-group">
          <label for="slug" class="col-sm-3 control-label">别名</label>
          <div class="col-sm-6">
            <input id="slug" class="form-control" name="slug" type="type" value="<?php echo $one['slug'];?>" placeholder="slug">
            <p class="help-block">https://zce.me/author/<strong><?php echo $one['slug'];?></strong></p>
          </div>
        </div>
        <div class="form-group">
          <label for="nickname" class="col-sm-3 control-label">昵称</label>
          <div class="col-sm-6">
              <input id="nickname" class="form-control" name="nickname" type="type" value="<?php echo $one['nickname'];?>" placeholder="昵称">
            <p class="help-block">限制在 2-16 个字符</p>
          </div>
        </div>
        <div class="form-group">
          <label for="bio" class="col-sm-3 control-label">简介</label>
          <div class="col-sm-6">
            <textarea id="bio" class="form-control" placeholder="Bio" cols="30" rows="6"><?php echo $one['bio'];?></textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-3 col-sm-6">
              <button type="submit" name="submit" class="btn btn-primary">更新</button>
            <a class="btn btn-primary" href="isusers.php">取消</a>
          </div>
        </div>
      </form>
    </div>
  </div>
  <div class="aside">
    <div class="profile">
      <img class="avatar" src="<?php echo $userinfo['avatar']?>">
        <h3 class="name"><?php echo $userinfo['nickname']?></h3>
    </div>
    <ul class="nav">
      <li>
          <a href="index.php"><i class="fa fa-dashboard"></i>仪表盘</a>
      </li>
      <li>
        <a href="#menu-posts" class="collapsed" data-toggle="collapse">
          <i class="fa fa-thumb-tack"></i>文章<i class="fa fa-angle-right"></i>
        </a>
        <ul id="menu-posts" class="collapse">
            <li><a href="isposts.php">所有文章</a></li>
          <li><a href="ispost-add.php">写文章</a></li>
          <li><a href="iscategories.php">分类目录</a></li>
        </ul>
      </li>
      <li>
        <a href="iscomments.php"><i class="fa fa-comments"></i>评论</a>
      </li>
      <li class="active">
          <a href="isusers.php"><i class="fa fa-users"></i><?php echo $one['nickname'];?>的资料</a>
      </li>
      <li>
        <a href="#menu-settings" class="collapsed" data-toggle="collapse">
          <i class="fa fa-cogs"></i>设置<i class="fa fa-angle-right"></i>
        </a>
        <ul id="menu-settings" class="collapse">
          <li><a href="isnav-menus.php">导航菜单</a></li>
          <li><a href="slides.php">图片轮播</a></li>
          <li><a href="issettings.php">网站设置</a></li>
        </ul>
      </li>
    </ul>
  </div>
  <script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
  <script>NProgress.done()</script>
</body>
</html>
